<?php
class Integral_typeModel extends Model {
	 //复制数据
	public function copy($siteid, $tositeid,$map, $pid = 0){
		$re=$this->where($map)->order('id')->select();
		if($re!==false){
			foreach($re as $k=>$v){
				$v['site_id'] = $tositeid;
                unset($v['id']);
				$this->data($v)->add();
				echo '<script>window.parent.progress("写入一个分类，ID为：'.$pid1.'");</script>';
				ob_flush();
                flush();
            }
			return true;
		}
	}
	public function getType(){
		return $this->where(array('site_id'=>__SITEID__))->select();	
	}
	public function getTypeField($field){
		return $this->where(array('site_id'=>__SITEID__))->getField($field);	
	}
}

?>